1. Field of the Invention
The present invention relates to a graphic drawing processing device (processor) and a graphic drawing processing system using the processor for drawing three-dimensional graphics and the like, and, in particular, to a graphic drawing processing system and device with a structure realized by a comparatively inexpensive cost whereby it is possible to perform high speed texture mapping by using a part of empty area (or unused area) in a frame memory for texture patterns during the texture mapping.
2. Description of the Prior Art
Because difficult or complicated coordinate calculations are required in texture mapping the process is normally carried out using software. However, there are cases where functions for simple coordinate conversions and the like are performed by hardware in order to implement the process at high speed.
FIG. 1 is a configuration drawing for a conventional graphic drawing processing device (processor) used in such cases. A graphic drawing processing device 100 of this conventional embodiment is provided with a texture mapping function. In FIG. 1, the graphic drawing processing device 100 has an interface section 11 for interfacing with a host CPU 3, a first and second digital differential analysis section 113 (the first differential analysis section for calculating paint-out with colors and the second digital differential analysis section for making regional decisions), an operation section 15 for performing pixel unit operations, a memory interface section 17 for controlling memory operation for a frame memory 5, and a coordinate conversion section 119 for converting coordinates in a drawing space to coordinates in a source space for texture patterns.
FIG. 2 illustrates an example of a structure for a graphic drawing system 200 using the graphic drawing processing device 100 shown in FIG. 1.
This graphic drawing system 200 is provided with a frame memory 5 formed as a Dynamic Random Access Memory (DRAM). For the data in the frame memory 5, one pixel in a display 9 uses several bits of data in the frame memory 5. In addition, in the frame memory 5 there is a data area (offscreen area) for data which is not displayed on the display 9. Two-dimensional coordinates (x, y) on the display 9 and an address `address` for the frame memory 5 are used to correspond to the pixels on the display 9 and the frame memory 5 so that they satisfy the following equation. In addition, the correspondence of the two-dimensional address and the frame memory 5 on the display 9 is shown in FIG. 3, EQU address=B+y.times.MW+x (1)
where B=base address, MW=the number of columns in the frame memory 5. PA1 a frame memory comprising: PA1 coordinate conversion means for obtaining pattern data corresponding to picture elements (or pixel) to be drawn, based on pattern source data in the offscreen area; and PA1 memory means for storing one portion of the pattern source data in the offscreen area. PA1 the memory means stores source data patterns corresponding to a desired area in the offscreen area of the frame memory, in graphic units, PA1 the coordinate conversion means obtains an address for the pattern source data corresponding to all the picture elements which form the desired graphics when writing into the drawing data area of the frame memory, and PA1 the graphic drawing processing system reads out, from the offscreen area, the desired pattern source data corresponding to all the picture elements which form the desired graphics, stores this data in the memory means, and then writes the data into the drawing data area, while referring to the memory means. PA1 a data area for storing, in n picture element units (where n is an optional positive integer), a plurality of source data units for patterns corresponding to a desired region in the offscreen area of the frame memory; and PA1 an address area for storing addresses in the frame memory for data corresponding to the data area, PA1 the coordinate conversion means obtains an address for the pattern source data corresponding to the picture elements when writing into the drawing data area of the frame memory, and PA1 the graphic drawing processing system comprises: PA1 wherein the memory means comprises: PA1 the coordinate conversion means obtains an address for the pattern source data corresponding to the picture elements when writing into the drawing data area of the frame memory, PA1 the graphic drawing processing system comprises: PA1 wherein the read-out of the pattern source data from the offscreen area in the frame memory and the write-in of the pattern source data to the memory means is performed in n picture element units. PA1 wherein the memory means is made up of memories associated in m ways (where m is an integer, 2 or greater); PA1 the graphic drawing processing device has a selection means for selecting the output from the pattern source data corresponding to a common address, from the results of the comparison by the comparison means. PA1 wherein the frame memory is formed from a plurality of banks and is controlled by an interleaved control method whereby the pattern source data inside each bank is accessed alternately. PA1 the graphic drawing processing system reads out the desired table data from the offscreen area and rewrites this data in the color look-up table, as required.
In addition, the data area (namely, the offscreen area), data in which is not shown on the display 9, in a part of the frame memory 5 is provided in this system and texture patterns to be drawn are set in the offscreen area. In general, an empty area in the frame memory 5, or one buffer, when a double buffer structure is provided and a single buffer used, is allotted as the offscreen area.
Next, two operations and for performing graphic drawing of a triangle will now be explained using the conventional graphic drawing processing device 100 with this type of structure described above when texture mapping is not performed (A) and performed (B).
Here, parameters and a starting point for drawing used by each digital differential analysis section 113 are provided in advance. (A) In a case where texture mapping is not performed
As shown in FIG. 3, starting from the initial drawing point on the two dimensional coordinates, the input of data from the frame memory 5 is displayed while the pixels are increased one by one in the x direction, and a one pixel offset is increased in the y-direction if being outside of the triangle.
The memory access at this time is carried out continuously while the drawing expands in the x-direction, therefore a high speed page mode write-in is possible. When changing to the y-direction, the memory access is carried out in a random mode because a page break occurs. (B) In a case where texture mapping is performed
On the other hand, when the triangle is drawn with texture mapping, the operation is as follows. From the two-dimensional coordinates for the drawn pixels, pixel coordinates (u, v) corresponding to texture space (a region with a texture pattern) are obtained (reverse conversion of coordinates), and pixels corresponding to texture source space are written in. Subsequently, the degree of brightness for drawing is added with the pixels and a drawing is made in the frame memory 5. This operation is implemented at each pixel in sequence along arrow directions as shown in FIG. 4 for the entire drawing area.
However, the following two types of problems are seen in the system which uses the conventional graphic drawing processing device 100 when the texture source space is used in common with the space for drawing in the frame memory 5.